﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using KishOnlineDomain.Domain;
using KishOnlineCommone.CarDTOs;
using KishOnlineDataAccess;
using KishOnlineCommone;

namespace KishOnlineDomain.Controller
{
    public class CarControllers
    {
        public CRUD<BrandDTO, Brand> CRUDBrand = new CRUD<BrandDTO,Brand>();
        public CRUD<ColorDTO, Color> CRUDColor = new CRUD<ColorDTO,Color>();
        public CRUD<ModelDTO, Model> CRUDModel = new CRUD<ModelDTO,Model>();
        public CRUD<ServiceDTO, Service> CRUDService = new CRUD<ServiceDTO,Service>();
        public CRUD<ServiceCategoryDTO, ServiceCategory> CRUDServiceCategory = new CRUD<ServiceCategoryDTO,ServiceCategory>();
        public CRUD<RegionDTO, Region> CRUDRegion = new CRUD<RegionDTO,Region>();
        public CRUD<CarAnnouncementTariffDTO, CarAnnouncementTariff> CRUDCarAnnouncementTariff = new CRUD<CarAnnouncementTariffDTO,CarAnnouncementTariff>();
        public CRUD<CarStatusDTO, CarStatus> CRUDCarStats = new CRUD<CarStatusDTO,CarStatus>();
        public CRUD<PriceRangeDTO, PriceRange> CRUDPriceRange = new CRUD<PriceRangeDTO,PriceRange>();
        public CRUD<ProvinceDTO, Province> CRUDProvince = new CRUD<ProvinceDTO,Province>();
        public CRUD<WatingForCallDTO, WatingForCall> CRUDWatingForCall = new CRUD<WatingForCallDTO,WatingForCall>();
        public CRUD<ModelSpecificationDTO, ModelSpecification> CRUDModelSpecification = new CRUD<ModelSpecificationDTO,ModelSpecification>();
        public CRUD<CarStoreTariffDTO, CarStoreTariff> CRUDCarStoreTariff = new CRUD<CarStoreTariffDTO,CarStoreTariff>();
        public CRUD<ServiceCenterTariffDTO, ServiceCenterTariff> CRUDServiceCenterTariff = new CRUD<ServiceCenterTariffDTO,ServiceCenterTariff>();

        public CRUDCar CRUDCar = new CRUDCar();
        public KishOnlineDomain.Domain.CarStore CarSotre = new Domain.CarStore();
        public KishOnlineDomain.Domain.ServiceCenter CRUDServiceCenter = new Domain.ServiceCenter();
        public KishOnlineDomain.Domain.CarAnnouncement CarAnnouncement = new Domain.CarAnnouncement();

        public PagingDTO<CarDTO> SearchAllCar(string txt, int start, int end, bool withTotal, bool SortByStartDate, bool isAscending)
        {
            return SerachAll.SerachAllCar(txt, start, end, withTotal, SortByStartDate, isAscending);
        }
        public PagingDTO<CarStoreDTO> SerachALLCarStore(string txt, int start, int end, bool withTotal, bool SortByStartDate, bool isAscending)
        {
            return SerachAll.SerachALLCarStore(txt, start, end, withTotal, SortByStartDate, isAscending);
        }
        public PagingDTO<ServiceCenterDTO> SerachALLService(string txt, int start, int end, bool withTotal, bool SortByStartDate, bool isAscending)
        {
            return SerachAll.SerachALLService(txt, start, end, withTotal, SortByStartDate, isAscending);
        }
        public AllRelatedEntityDTO GetRelatedEntity(object entity)
        {
            return GetRelated.GetRelatedEntity(entity);
        }
        public AllRelatedEntityDTO GetTopEntity(int Count)
        {
            return TopAll.GetTopEntity(Count);
        }

        public PagingDTO<InActiveCarsDTO> GetInActiveAnnouncement(string Owner, string carModel, int start, int end, bool WithTotal)
        {
            return new AdminTasks().GetInActiveAnnouncement(Owner, carModel, start, end,WithTotal);
        }
        public bool IsCurrentUserOwnerOfCar(int carID)
        {
            return CRUDCar.IsCurrentUserOwnerOfCar(carID);
        }
    }
}
